Here you go. You'll have to create the character style in your document, and I've assumed that it is not inside a CharacterStyleGroup. //DESCRIPTION: Replace Anchored Images with Styled Text (function(){ if (app.documents.length > 0) { var anchArray = [ // edit names; add new pairs as needed {'name' : "parking.eps", 'char' : "§"}, {'name' : "swimmingpool.eps", 'char' : "#"}, {'name' : "o-fc1_setup.pdf", 'char' : "∏"} // my test case ] replaceAnchors(app.documents[0], anchArray); } function replaceAnchors(aDoc, anchArray) { var links = aDoc.links.everyItem().getElements(); for (var j = links.length - 1; j >= 0; j--) { var anchor = getAnchor(links ); if (anchor == null) continue; // link not anchored var aChar = getCharacter(links .name, anchArray); if (aChar != null) { anchor.contents = aChar; anchor.appliedCharacterStyle = "StyleKYB" } } } function getCharacter(linkName, anchArray) { for (var j = anchArray.length - 1; j >= 0; j--) { if (linkName == anchArray .name) { return anchArray ['char']; } } return null; } function getAnchor(link) { var theChar = link.parent.parent.parent; if (theChar instanceof Character) { return theChar; } return null; // not anchored } }()) I'd appreciate you indicating that I have correctly answered your question. Thanks, Dave
... View more